<template>
  <div id="app">
    <transition enter-active-class="animated slideInRight"
                leave-active-class="animated slideOutLeft">
      <router-view class="router-view"></router-view>
    </transition>
  </div>
</template>

<script>
  import { initSocket } from '@/utils/socket'

  export default {
    mounted () {
      window.addEventListener('message', (e) => {
        if (e.data.userId) {
          localStorage.setItem('userAuth', JSON.stringify(e.data))
          initSocket(e.data)
        }
      }, false)
    }
  }
</script>

<style lang="scss">
  @import "./assets/css/reset.scss";
  @import "./assets/css/common.scss";
</style>
